package com.tarry.set;


import lombok.*;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
/**
 * 学生
 */
public class Student implements Comparable<Student>{
    private String name;
    private int age;
    @Override
    public int compareTo(Student o) {
        int length = this.name.length() - o.name.length();
        int result = length == 0 ? this.name.compareTo(o.name) : length;
        return result == 0 ? this.age - o.age : result;
    }

}
